import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login'
import pagehome from '@/components/pagehome'
import home from '@/components/home'

import mypage from '@/components/home/mypage'
import workpage from '@/components/home/workpage'
import docpage from '@/components/home/docpage'

import itemCare from '@/components/pageModule/itemCare' //项目列表
import itemsDetails from '@/components/secondPage/itemsDetails'//项目详情页
import articleDetails from '@/components/secondPage/articleDetails'//文章详情页

Vue.use(Router)

export default new Router({
	mode:'history',
    routes: [
	    {
	        path: '/home',//中间页
	        name: 'home',
	        component: home,
	        children:[//嵌套路由
				{ path: 'index', component: mypage},//项目列表页
	            { path: 'workpage',component: workpage},//文章列表页
				{ path: 'docpage', component: docpage},//日记列表页
				{
					path: '/home/index/itemsDetails',//项目详情页
					name: 'itemsDetails',
					component: itemsDetails
				},
				{
					path: '/home/workpage/articleDetails',//文章详情页
					name: 'articleDetails',
					component: articleDetails
				}
	        ]
	    },
	    {
	        path: '/',//登录页1
	        name: 'login',
	        component: login
		},
		{
	        path: '/login',//登录页2
	        name: 'login',
	        component: login
		},
		{
			path: '/itemCare',//项目模块
			name: 'itemCare',
			component: itemCare
		}
    ]
})
